package studentCourseSystem.entity;
public class Teacher extends Person {
    private Course taughtCourse;
    public Teacher(String teacherId, String name, String gender) {
        super(teacherId, name, gender);
        this.taughtCourse = null;
    }
    public void teachCourse(Course course) {
        this.taughtCourse = course;
        course.setTeacher(this);
        System.out.println(name + "（教师）开始讲授课程：" + course.getCourseName());
    }
    @Override
    public void printWorkSheet() {
        if (taughtCourse != null) {
            System.out.println("=== " + name + "的授课信息 ===");
            System.out.println("教师编号：" + id);
            System.out.println("课程名称：" + taughtCourse.getCourseName());
            System.out.println("上课地点：" + taughtCourse.getLocation());
            System.out.println("上课时间：" + taughtCourse.getTime());
        } else {
            System.out.println(name + "（教师）未讲授任何课程！");
        }
    }
    public Course getTaughtCourse() {
        return taughtCourse;
    }
}